# # -*- coding: utf-8 -*-
# from datetime import timedelta
# from utils.operators.spark_submit import SparkSubmitOperator
# from jms.dwd.spmi.dwd_spmi_operation_bill_dt import spmi_dwd__dwd_spmi_operation_bill_dt
# from jms.dwd.spmi.dwd_piece_waybill_dt import spmi_dwd__dwd_piece_waybill_dt
#
# executeDay = '{{ var.value.spmi_mark }}'
# spmi_dwd__dwd_volume_cost_profit_bill_dt__operation = SparkSubmitOperator(
#     task_id='spmi_dwd__dwd_volume_cost_profit_bill_dt__operation',
#     email='songjun@yl-scm.com,chenyijia@yl-scm.com',
#     pool_slots=5,
#     execution_timeout=timedelta(hours=2),
#     name='spmi_dwd__dwd_volume_cost_profit_bill_dt__operation_{{ execution_date | date_add(1) | cst_ds_nodash }}',
#     driver_cores=4,
#     driver_memory='8G',
#     executor_cores=2,
#     executor_memory='4G',
#     num_executors=8,
#     conf={'spark.dynamicAllocation.enabled': 'true',  # 动态资源开启
#           'spark.shuffle.service.enabled': 'true',  # 动态资源 Shuffle 服务开启
#           'spark.dynamicAllocation.maxExecutors': 210,  # 动态资源最大扩容 Executor 数
#           'spark.dynamicAllocation.cachedExecutorIdleTimeout': 60,  # 动态资源自动释放闲置 Executor 的超时时间(s)
#           'spark.sql.sources.partitionOverwriteMode': 'dynamic',  # 允许删改已存在的分区
#           'spark.executor.memoryOverhead': '2G',  # 堆外内存
#           'spark.sql.shuffle.partitions': 3600,
#           'spark.default.parallelism': 3600,
#           },
#     hiveconf={'hive.exec.dynamic.partition': 'true',  # 动态分区
#               'hive.exec.dynamic.partition.mode': 'nonstrict',
#               'hive.exec.max.dynamic.partitions': 880,  # 每天生成 20 个分区
#               'hive.exec.max.dynamic.partitions.pernode': 880,  # 每天生成 20 个分区
#               },
#     java_class='com.yunlu.bigdata.jobs.spmi.SpmiVolumeCostProfitOperation03',  # spark 主类
#     application='hdfs:///scheduler/jms/spark/chp/spmi/dwd/SpmiVolumeCostProfit.jar',
#     application_args=['{{ execution_date | cst_ds }}',executeDay],  # 参数dt 2020-10-26
# )
#
#
# spmi_dwd__dwd_volume_cost_profit_bill_dt__operation << [spmi_dwd__dwd_spmi_operation_bill_dt,
#                                                         spmi_dwd__dwd_piece_waybill_dt,
#  ]
